package project.p1_car



object GlobalContent {

}



/**
 * 卡口上传数据，通过kafka消费而来
 */
case class TrafficInfo(action_time:Long,
                       monitor_id:String,
                       camera_id:String,
                       car:String,
                       speed:Double,
                       roadId:String,
                       areaId:String)


case class TrafficMonitorLog(action_time:Long,
                       monitor_id:String,
                       camera_id:String,
                       car:String,
                       speed:Double,
                       roadId:String,
                       areaId:String)

/**
 * 动态更新的卡口限速信息
 */
case class MonitorInfo(
                        monitor_id:String,
                      roadId:String,
                      speedLimit:Int,
                      areaId:String)

/**
 *
 * 实时计算的超速车辆信息，入库到mysql
 */
case class OutOfSpeedingInfo(
                          car:String,
                          monitorId:String,
                          roadId:String,
                          realSpeed:Double,
                          limitSpeed:Int,
                          actionTime:Long) {
  override def toString: String = {
    s"$car  $monitorId  $limitSpeed  $realSpeed"
  }


  //某个时间范围内卡口的平均车速和通过的车辆数量
case class AvgSpeedInfo(start:Long,end:Long,monitorId:String,avgSpeed:Double,carCount:Int)


}